<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set value="<%=request.getContextPath()%>" var="ctx"></c:set>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>订单中心</title>
    <meta name="viewport" content="width=device-width,user-scalable=no, initial-scale=1">
    <meta name="format-detection" content="telephone=yes">
    <meta name="msapplication-tap-highlight" content="no">
      <link href="${ctx}/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="${ctx}/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <!-- Data Tables -->
    <link href="${ctx}/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
    <link href="${ctx}/css/animate.css" rel="stylesheet">
    <link href="${ctx}/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="${ctx}/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
        <!-- 全局js -->
    <script src="${ctx}/js/jquery.min.js?v=2.1.4"></script>
    <script src="${ctx}/js/bootstrap.min.js?v=3.3.6"></script>

    <!-- Data Tables -->
    <script src="${ctx}/js/plugins/dataTables/jquery.dataTables.js"></script>
    <script src="${ctx}/js/plugins/dataTables/dataTables.bootstrap.js"></script>
    <script src="${ctx}/js/plugins/layer/layer.min.js"></script>
    <script src="${ctx}/js/plugins/layer/laydate/laydate.js"></script>
    <!-- 自定义js -->
    <script src="${ctx}/js/content.js?v=1.0.0"></script>
    <script src="${ctx}/js/plugins/sweetalert/sweetalert.min.js"></script>
    <style>
    	#container1{
    		position:absolute;
    		width:500px;
    		border:1px solid red;
    		top:0px;
    		margin:0px 35%;
    	}
    	table{
    		text-align:center;
    	}
    </style>
</head>
<body>
 <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox">
                    <div class="ibox-title">
                        <div class="row">
                           <div class="col-sm-3">
                                <h3>评论审核</h3>
                           </div>
                        </div>
                    </div>
                    <div class="ibox-content">
<!--                         <div id="progressBar" class="sk-spinner sk-spinner-wave" > -->
<!--                             <div class="sk-rect1"></div> -->
<!--                             <div class="sk-rect2"></div> -->
<!--                             <div class="sk-rect3"></div> -->
<!--                             <div class="sk-rect4"></div> -->
<!--                             <div class="sk-rect5"></div> -->
<!--                         </div> -->
                        <table class="table table-striped table-bordered table-hover dataTables-example text-center">
                            <thead>
                                <tr>
                              		  <th class="text-center">序号</th>
                                    <th class="text-center">头像</th>
                                    <th class="text-center">昵称</th>
                                    <th class="text-center">时间</th>
                                    <th class="text-center">内容</th>
                                    <th class="text-center">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                            </tbody>
    				 </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
<script src="${ctx}/js/util.js"></script>
<script>
var sending = false;

var queryIndex = 1;
var table = null;
var index_ = 1;
$(document).ready(function(){
	var href = location.href;
	var length = href.length;
	var index = href.charAt(length-1);
	table = $('.dataTables-example').DataTable({
		"bPaginate" : true,//翻页功能
		"bSort" : false,//排序功能
		"aoColumns" : [
		               					{"sClass" : "center",
		    											"mRender" : function(
		    													data, type,
		    													full) {
		    													return full.id;
		    											}
		               					},
										{
											"sClass" : "center",
											"mRender" : function(
													data, type,
													full) {
													return "<img width=50 height=50 src='"+full.img_+"' />";
											}
										},
										{
											"sClass" : "center name",
											"mRender" : function(
													data, type,
													full) {
												return full.nick_name_;
											}
										},
										{
											"sClass" : "center value penma",
											"mRender" : function(
													data, type,
													full) {
												return full.time_;
											}
										},
										{
											"sClass" : "center value daima",
											"mRender" : function(
													data, type,
													full) {
												return full.content_;
											}
										},
										{
											"sClass" : "center value",
											"mRender" : function(
													data, type,
													full) {	
												var btns =  "<button type='button' class='btn btn-primary'  onclick='right(\""
													+ full.id
													+ "\");return false;' >通过审核</button>";
												return btns;									
											}
										}
										]
	});
		sendReq("${ctx}/comment",{},function(data){
			for(var i =0,len=data.length;i<len;i++){
				table.row.add(data[i]);
			}
 				table.draw();
		});
	});
function right(id){
	sendReq("${ctx}/comment/go",{id:id},function(){
		location.reload();
	})
	
}

</script>
</html>
